/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import model.SanPham;
import java.util.*;
/**
 *
 * @author NGH-PC
 */
@Controller
@RequestMapping(value = "/hello")
public class HelloController {
    @RequestMapping(value = "/xinchao",method = RequestMethod.GET)
    public String xinchao(ModelMap mm ){
        mm.put("a","Tran Thanh Nghia");
        mm.put("sp",new SanPham("123", "nghia dep zai", 1000));
        List<SanPham> listSP=new ArrayList<SanPham> ();
        for(int i=0;i<=5;i++){
            listSP.add(new SanPham("sp"+i, "ten sp"+i, i+1000));
        }
        mm.put("dssp", listSP);
        return "xinchao";
    }
}
